home *** CD-ROM | disk | FTP | other *** search
- // gtest.cpp: Tests the Grso, Gfso, and Wso types by displaying
- // two objects and writing to them. Try moving the objects around
- // by dragging them by their border"s using the mouse or use the
- // shift arrow keys. Press ALT-X to quit the program.
-
- #include "grphscrn.h"
- #include <conio.h>
-
- Wso *W1, *W2;
- int I, J;
- int Gd, Gm;
-
- main()
- {
- Rso *Ip;
-
- Gd = DETECT;
- Setup(MouseOptional, Gd, Gm, "\\tcpp\\bgi", SANS_SERIF_FONT);
- FullScrn->Panel->Clear(' ', 0x70); // Clear the screen using grey
- // Draw a series of boxes on the screen
- Mouse.Hide();
- for (J = 0; J <= getmaxy() / 20; J++) {
- for (I = 0; I <= getmaxx() / 20; I++) {
- FullScrn->Panel->Interior->Box(
- I*20+3, J*20+2, 15, 15, Relief+1, GrphColors.Bc);
- }
- }
- Mouse.Show();
- // Create a window and display a message to it that will be clipped
- W2 = new Wso(0x11, WindowStyle, ErrColors);
- W2->SetSize(200, 80);
- W2->Open(FullScrn, 5, 5);
- W2->Panel->HzWrt(15, 15, "This message is clipped", 0);
- // Display another window and write a circle in it
- W1 = new Wso(Relief+3, WindowStyle-BorderPrompt, GrphColors);
- W1->SetSize(101, 100);
- W1->Open(FullScrn, 210, 70);
- setcolor(0);
- Mouse.Hide();
- Ip = W1->Panel->Interior;
- circle(Ip->Xul+Ip->Wd/2, Ip->Yul+Ip->Ht/2, Ip->Wd/2);
- Mouse.Show();
- MainEventLoop();
- CleanUp();
- }
-
-
-